<%@ page import="java.io.*" %>
<%@ page import="java.util.*" %>
<%@ page import="java.sql.*" %>
<%@ page import="java.text.*" %>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"   pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>IPL 5 - Registration Details</title>
    <meta name="keywords" content="" />
    <meta name="description" content="" />
    <meta http-equiv="content-type" content="text/html; charset=utf-8" />
    <meta http-equiv="content-language" content="" />
    <link href="css/style.css" rel="stylesheet" type="text/css" />

<script>
	<!--
	/*
	Auto Refresh Page with Time script
	By JavaScript Kit (javascriptkit.com)
	Over 200+ free scripts here!
	*/
	
	//enter refresh time in "minutes:seconds" Minutes should range from 0 to inifinity. Seconds should range from 0 to 59
	var limit="3:00"
	
	if (document.images){
		var parselimit=limit.split(":")
		parselimit=parselimit[0]*60+parselimit[1]*1
	}
	function beginrefresh(){
		if (!document.images)
			return
		if (parselimit==1)
			window.location.reload()
		else{ 
			parselimit-=1
			curmin=Math.floor(parselimit/60)
			cursec=parselimit%60
			if (curmin!=0)
				curtime=curmin+" minutes and "+cursec+" seconds left until page refresh!"
			else
				curtime=cursec+" seconds left until page refresh!"
			window.status=curtime
			setTimeout("beginrefresh()",1000)
		}
	}
	
	window.onload=beginrefresh
	//-->
</script>

</head>
<body>
<%@ include file="global.jsp" %>
<%
String userName = (String) session.getAttribute("userName");
String league = (String) session.getAttribute("league");
if(null != userName){
	
%>
<div id="page">
<div id="header">
<h1><a href="#">IPL-5 2012</a></h1>
</div>
<%@ include file="links.jsp" %>
		<div>
			<table width="100%">
				<tr>
					<td align="right">
						Logged User: <%=userName%> &nbsp; <a href="logout.jsp">logout</a>
					</td>
				</tr>
			</table>
			
		</div>
<div id="main">
<div id="content">
<center>
<!--h2>DISHUM DISHUM</h2-->
</center>

<div class="clearthis">&nbsp;</div>
<!-- Start of New Item Description -->
<form action="/IPL5/processChat.jsp" method="post">
<table align="left" border="0" cellspacing="2" cellpadding="2" width=80%>
	<tr align="left">
		<td>UserName:</td>
		<td><input disabled="true" type="text" name="chatUser"  value="<%=userName%>"/>&nbsp;&nbsp;League
			<input disabled="true" type="text" name="chatUser"  value="<%=league%>"/>		
		</td>
	</tr>
	<tr align="left">
		<td>Comment:</td>
		<td><TEXTAREA NAME="comments" COLS="75" ROWS="3"></TEXTAREA></td>
		<td colspan="1"><input type="image" src="images/button_go.gif"
			class="button" /></td>
	</tr>
</table>
</form>
<br/><br/>

<table align="left" width="100%" cellpadding="0" cellspacing="0">
	<tr valign="top">
		<td  align="left">
		
		
		<table align="left" border="1" cellspacing="2" cellpadding="2"	width=90%>
		<caption><b>DISHUM DISHUM</b></caption>
			<%
				try {
					Class.forName(db_driver);
					Connection conn = DriverManager.getConnection(db_url, db_user, db_password);
					Statement stmt = conn.createStatement();
					System.out.print("select chatUser, comments, dateFormat from comments where league='"+league+"' order by id DESC  LIMIT 45");
					ResultSet rset = stmt.executeQuery("select chatUser, comments, dateFormat from comments where league='"+league+"' order by id DESC  LIMIT 45");
					int rowCount = 2;
					while (rset.next()) {
						
						String name = rset.getString(1);
						/*if (name.equalsIgnoreCase("CINDY")) {
							out
									.println("<tr valign='top' align=left><td><b><font color='#FF3300'>"
											+ name.toUpperCase()
											+ "</font></b>:"
											+ rset.getString(2)
											+ "---@"
											+ rset.getString(3) + "</td></tr>");
						} else if (name.equalsIgnoreCase("SANDY")) {
							out
									.println("<tr align=left><td><b><font color='#6600CC'>"
											+ name.toUpperCase()
											+ "</font></b>:"
											+ rset.getString(2)
											+ "---@"
											+ rset.getString(3) + "</td></tr>");
						} else if (name.equalsIgnoreCase("VARA")
								|| name.equalsIgnoreCase("VARAM")) {
							out
									.println("<tr align=left><td><b><font color='#FF00FF'>"
											+ name.toUpperCase()
											+ "</font></b>:"
											+ rset.getString(2)
											+ "---@"
											+ rset.getString(3) + "</td></tr>");
						} else if (name.equalsIgnoreCase("GVRAO")) {
							out
									.println("<tr align=left><td><b><font color='#339900'>"
											+ name.toUpperCase()
											+ "</font></b>:"
											+ rset.getString(2)
											+ "---@"
											+ rset.getString(3) + "</td></tr>");
						} else if (name.equalsIgnoreCase("SUKU")) {
							out
									.println("<tr align=left><td><b><font color='#990099'>"
											+ name.toUpperCase()
											+ "</font></b>:"
											+ rset.getString(2)
											+ "---@"
											+ rset.getString(3) + "</td></tr>");
						} else if (name.equalsIgnoreCase("SRIPAD")) {
							out
									.println("<tr align=left><td><b><font color='#006600'>"
											+ name.toUpperCase()
											+ "</font></b>:"
											+ rset.getString(2)
											+ "---@"
											+ rset.getString(3) + "</td></tr>");
						} else if (name.equalsIgnoreCase("VENU")) {
							out
									.println("<tr align=left><td><b><font color='#CC0000'>"
											+ name.toUpperCase()
											+ "</font></b>:"
											+ rset.getString(2)
											+ "---@"
											+ rset.getString(3) + "</td></tr>");
						} else if (name.equalsIgnoreCase("KRAVI")) {
							out
									.println("<tr align=left><td><b><font color='#000099'>"
											+ name.toUpperCase()
											+ "</font></b>:"
											+ rset.getString(2)
											+ "---@"
											+ rset.getString(3) + "</td></tr>");
						} else if (name.equalsIgnoreCase("DRAVI")) {
							out
									.println("<tr align=left><td><b><font color='#00FF00'>"
											+ name.toUpperCase()
											+ "</font></b>:"
											+ rset.getString(2)
											+ "---@"
											+ rset.getString(3) + "</td></tr>");
						} else {
							out.println("<tr align=left><td><b>"
									+ name.toUpperCase() + "</b>:"
									+ rset.getString(2) + "---@"
									+ rset.getString(3) + "</td></tr>");
						}*/
						if ( (rowCount % 2) == 0)
						{
							out.println("<tr align=left><td style='background-color:#FFFFCC; color:black;height:30px'><b>"
									+ name.toUpperCase() + "</b> : "
									+ rset.getString(2) + "       &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@"
									+ rset.getString(3) + "</td></tr>");
						}
						else
						{
							out.println("<tr align=left><td style='background-color:#993333;color:black; height:30px'><b>"
									+ name.toUpperCase() + "</b> : "
									+ rset.getString(2) + "       &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@"
									+ rset.getString(3) + "</td></tr>");
						}
						rowCount++;
					}
					rset.close();
					stmt.close();
					conn.close();
					out.println("<div class='f_divider'>&nbsp;</div>");
				} catch (Exception e1) {
					e1.printStackTrace();
				} finally {
				}
			%>
		</table>
		</frameset>
		</td>
		<td>
		<table>

		</table>
		</td>
	</tr>
</table>


</div>
<!-- content --></div>
<!-- main --></div>
<!-- page -->
<div id="footer">
<p>Copyright &copy; 2012, designed by <a
	href="http://www.kiranvenkat.in/">kiranvenkat.in</a></p>
</div>
</body>
</html>
<%
	if ( session.getAttribute("resposeText") != null && !("").equals(session.getAttribute("resposeText")))
	{ 
			session.setAttribute("resposeText", null);
	}
}else {
	%>
		<jsp:forward   page="login.jsp"/>
	<%
}
%>